from Tkinter import *
from VTK import *
  
# Make a root window
root = Tk() 

# Add a vtkTkRenderWidget
renderWidget = vtkTkRenderWidget(root,width=400,height=400)
renderWidget.pack(expand='true',fill='both')

# Get the render window from the widget
renWin = renderWidget.GetRenderWindow()

# Next, do the VTK stuff
ren = vtkRenderer()
renWin.AddRenderer(ren)
cone = vtkConeSource()
cone.SetResolution(16)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)

# Make a quit button
def quit():
    root.destroy()
    
button = Button(text="Quit",command=quit)
button.pack(expand='true',fill='x')

# start up the event loop
root.mainloop()
